Trilium supports Mermaid, which adds support for various diagrams such as flowchart, sequence diagram, class diagram, state diagram, pie charts, etc., all using a text description of the chart instead of manually drawing the diagram.

For the official documentation of Mermaid.js see mermaid.js.org/intro/.

Layouts

Depending on the chart being edited and user preference, there are two layouts supported by the Mermaid note type:

It's possible to switch between the two layouts at any time by pressing the icon in the Floating buttons area.

Interaction

Errors in the diagram

If there is an error in the source code, the error will be displayed in an information pane.

During the state of an error, the diagram will no longer be rendered and the previously working diagram will remain in the preview section.